SolDEX Case Study

Avatar
11 January 2023 Updated on  Обновлено   14 June 2023

Soldex DEX

Introduction

We were approached by a client with the task of creating various trading pairs on their decentralized cryptocurrency exchange (DEX) called SolDEX. He explained to us that the team that made this exchange for them could not figure out how and how to fill the exchange with trading pairs, but could only figure out and adjust the already developed functionality as a whole to the client’s corporate identity.

For us, this task was not something new, since our Polygant team has already developed more than one DEX exchange and perfectly understands all the subtleties of this issue.

We changed the brand name and blurred out any references in the screenshots so as not to violate the NDA for our client.

Peculiarities

  • Fill the exchange with trading pairs
  • Conduct a review of the current code, evaluate possible improvements and their complexity

Development

Decentralized exchanges in most cases work on the DEX-AMM model.

AMM is an automatic market making technology. Instead of a traditional book order, liquidity pools of pairs of assets are used, and prices are calculated according to a formula based on their ratio in the pool. This formula looks like this:

x*y=k

where x is the Ethereum reserve (or BNB, depending on which network the exchange owner chose to work on);
y – reserve of tokens;
k is a constant.

When ETH is exchanged for tokens, the user invests them in smart contracts, and in return receives a certain number of tokens.

Before proceeding with the main task that the client approached us with, namely the creation of trading pairs, we conducted a SolDEX project review. During the review, multiple shortcomings were revealed both in the code itself and in many aspects related to security. A full report was handed over to the client, we suggested that we first deal with the identified problems, and later move on to the main task.

After we fixed all the problems identified during the code and project reviews, our team began the initial task.

Due to the fact that the exchange was developed before us by a rather incompetent development team in this matter, we had to rewrite the smart contract of the exchange, as it made mistakes in the logic of the exchange, as well as in ensuring liquidity, and it (liquidity) makes trading possible for tokens on the SolDEX exchange.

As a result, we launched the exchange from scratch. Thanks to the detection of errors in the logic of the exchange and their correction, we also completed the initial task with which the client approached us without any problems, namely, adding trading pairs.

We have added over 20 trading pairs to the SolDEX exchange. In the future, this client contacted us on some issues related to the exchange and we were happy to provide consulting services and help resolve this or that issue.

SolDEX логотип

Введение

К нам обратился клиент с задачей создать различные торговые пары на их децентрализованной криптовалютной бирже (DEX) под названием SolDEX. Он объяснил нам, что команда, которая сделала для них эту биржу, не смогла разобраться, как наполнить ее торговыми парами, а только смогла подстроить уже разработанные функции под фирменный стиль клиента.

Для нас эта задача не являлась чем-то новым, так как наша команда Polygant разработала уже не одну DEX биржу и прекрасно понимает все тонкости данного вопроса.

Мы заменили название бренда и замазали любые упоминания на скриншотах, чтобы не нарушать НДА в отношении нашего клиента.

Особенности

  • Наполнить биржу торговыми парам
  • Провести ревью текущего кода, оценить возможные доработки и их сложность

Разработка

Децентрализованные биржи в большинстве случаев работают по модели DEX-AMM

AMM — это технология автоматического маркет мейкинга. Вместо традиционного ордер бука применяются пулы ликвидности из пар активов, а цены рассчитываются по формуле исходя из их соотношения в пуле. Данная формула выглядит следующим образом:

x*y=k

где x – это резерв Ethereum (либо BNB, в зависимости от того, в какой сети владелец биржи выбрал свою работу);

y – резерв токенов;

k – константа.

Когда происходит обмен ETH на токены, то пользователь вкладывает их в смарт-контракты, а взамен получает некоторое число токенов. 

Прежде чем приступить к основной задаче — созданию торговых пар на бирже SolDEX, с которой к нам обратился клиент, мы провели ревью проекта. В ходе ревью были выявлены множественные недочеты как в самом коде, так и по многим моментам, относящимся к безопасности. Полный отчет был передан клиенту, мы предложили вначале разобраться с выявленными проблемами, а позже переходить к основной задаче.

После того как наша команда исправила все проблемы, выявленные в ходе ревью кода и проекта, мы приступили к первоначальной задаче.

Ввиду того, что биржу до нас разрабатывала достаточно некомпетентная команда разработчиков в данном вопросе, нам пришлось переписывать смарт-контракт биржи, так как в нем были допущены ошибки в логике проведения обмена, а также по обеспечению ликвидности, а она (ликвидность) делает возможным торги по токенам на бирже.

SolDEX интерфейс, торговые пары

По итогу биржу SolDEX мы запустили заново с чистого листа. Благодаря обнаружению ошибок в логике биржи и их исправлению мы без проблем выполнили и первоначальную задачу — добавление торговых пар, с которой к нам обратился клиент.

Мы добавили более 20 торговых пар на биржу. В дальнейшем этот клиент обращался к нам по некоторым вопросам, связанным с биржей, и мы с удовольствием оказывали консультационные услуги и помогали по любым просьбам.

Похожие статьи:
Related Articles
Play2Earn Game Development
map

Feel Free to Contact Us